#ifndef HERMITEINTERPOLATION_HPP
#define HERMITEINTERPOLATION_HPP

#include "Function.hpp"
#include <vector>
#include <functional>

class HermiteInterpolation : public Function {
private:
    std::vector<double> x; // 插值节点的 x 坐标
    std::vector<double> y; // 插值节点的 exp 阶值
    std::vector<int> exp; // 插值节点的阶数
    std::vector<double> z; // 插值节点的差商值

public:
    HermiteInterpolation(const std::vector<double>& x, const std::vector<double>& y, const std::vector<int>& exp);
    virtual ~HermiteInterpolation() {}

    double operator()(double x) const override;
    double derivative(double x) const override;

    // 返回插值多项式的次数
    int getDegree() const;
};

#endif // HERMITEINTERPOLATION_HPP